import { createRouter } from "vue-router"
import { createWebHistory } from "vue-router"
import { createWebHashHistory } from "vue-router"

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home/index.vue'),
    children: [
      {
        path: '/home/test',
        name: 'homeTest',
        component: () => import('../views/home/test.vue')
      },
    ]
  },
  {
    path: '/nextTick',
    name: 'nextTick',
    component: () => import('../views/nextTick/index.vue')
  },
  {
    path: '/passValue',
    name: 'passValue',
    component: () => import('../views/passValue/index.vue')
  },
  {
    path: '/teleport',
    name: 'teleport',
    component: () => import('../views/teleport/index.vue')
  },
  {
    path: '/watch',
    name: 'watch',
    component: () => import('../views/watch/index.vue')
  },
  {
    path: '/linkageForm',
    name: 'linkageForm',
    component: () => import('../views/linkageForm/index.vue')
  },
  {
    path: '/project',
    name: 'project',
    children:[
      {
        path: '/project/list',
        name: 'projectList',
        component: () => import('../views/project/list.vue')
      },
      {
        path: '/project/details',
        name: 'projectDetails',
        component: () => import('../views/project/details.vue')
      }
    ]
  },
  {
    path: '/form',
    name: 'form',
    component: () => import('../views/form/index.vue')
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
